﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace Sinacor.Infra.UI.Common
{
    public class PropertyChangedEventManager : BaseWeakEventManager<PropertyChangedEventManager, INotifyPropertyChanged, PropertyChangedEventArgs>
    {
        protected override void StartListening(object source)
        {
            INotifyPropertyChanged s = source as INotifyPropertyChanged;
            if (s != null)
                s.PropertyChanged += new PropertyChangedEventHandler(HandleEvent);
        }

        protected override void StopListening(object source)
        {
            INotifyPropertyChanged s = source as INotifyPropertyChanged;
            if (s != null)
                s.PropertyChanged -= new PropertyChangedEventHandler(HandleEvent);
        }
    }
}
